<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <form action="{:U('save')}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">学生姓名<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$data.name}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">学生编号<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="noid" value="{$data.noid}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">性别<span class="check-tips"></span></label>
            <div class="controls">
                <label class="radio"><input type="radio" name="sex" value="1" checked >男</label>
                <label class="radio"><input type="radio" name="sex" value="2" <php>if(2==$data['sex'])echo 'checked';</php> >女</label>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">生日<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" id="birthday" name="birthday" value="{$data.birthday}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">家长姓名<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="parent_name" value="{$data.parent_name}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">家长电话<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="parent_phone" value="{$data.parent_phone}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">家庭地址<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="address" value="{$data.address}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">状态<span class="check-tips"></span></label>
            <div class="controls">
                <select name="status">
                    <option value="1" selected="selected">待确认</option>
                    <option value="2" <php>if(2==$data['status'])echo 'selected="selected"';</php> >已确认</option>
                    <option value="3" <php>if(3==$data['status'])echo 'selected="selected"';</php> >已签约</option>
                </select>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">备注<span class="check-tips"></span></label>
            <div class="controls">
                <label class="textarea input-large">
                    <textarea name="remark">{$data.remark}</textarea>
                </label>
            </div>
        </div>

        <eq name="data.source" value="2">
        <div class="form-item">
            <label class="item-label">来源<span class="check-tips"></span></label>
            <div class="controls">
                <label class="radio"><input type="radio" name="source" value="1" checked >自然</label>
                <label class="radio"><input type="radio" name="source" value="2" <php>if(2==$data['source'])echo 'checked';</php> >介绍</label>
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">介绍人<span class="check-tips"></span></label>
            <div class="controls">
                <p>{$data.introducer_id|_getIntroducer}</p>
            </div>
        </div>
        </eq>


        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
        <input type="hidden"  name="id" value="{$data.id}" >
    </form>
</block>

<block name="script">
    <script type="text/javascript">

        laydate.render({
            elem: '#birthday'
        });

        function clearNoNum(obj)
        {
            obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符
            obj.value = obj.value.replace(/^\./g,"");  //验证第一个字符是数字而不是.
            obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的.
            obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        }
    //导航高亮
    highlight_subnav('{:U('Student/index')}');
    </script>
 </block>
